package com.five.pojo.dto;

import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Data
public  class OrderItemDTO {
        @NotNull(message = "商品ID不能为空")
        private Long productId;

        @Min(value = 1, message = "购买数量不能小于1")
        private Integer quantity;

        @NotNull(message = "商品单价不能为空")
        @DecimalMin(value = "0.01", message = "商品单价必须大于0")
        private BigDecimal unitPrice;
    }